package engine.expression;

public enum OperatorsBinary implements Operators
{
	Plus("+", (x,y) -> x+y),
	Moins("-",  (x,y) -> x-y),
	Produit("*", (x,y) -> x*y),
	Division("/",  (x,y) -> x/y);
	
	private String representation;
	private Calculable calcul;
	
	private OperatorsBinary(String representation, Calculable calcul)
	{
		this.representation = representation;
		this.calcul = calcul;
	}
	
	public String toString()
	{
		return representation;
	}
	
	public double calculate(double d, double e)
	{
		return calcul.calculate(d,e);
	}
	
	public boolean unary()
	{
		return false;
	}
}
